package com.platform.wechat.service.impl;

import com.platform.wechat.common.JsonBean;
import com.platform.wechat.mapper.NoticeMapper;
import com.platform.wechat.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author YP
 * @company ~~
 * @create 2021-07-28 14:10
 */
@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;

    /**
     * 根据公告类型查询公告
     * @param noticeType
     * @return
     */
    @Override
    public JsonBean selectByNoticeType(Integer noticeType) {
        return new JsonBean(0, "ok", noticeMapper.selectByNoticeType(noticeType));
    }

    /**
     * 根据公告主键查询公告
     * @param id
     * @return
     */
    @Override
    public JsonBean selectById(Integer id) {
        return new JsonBean(0, "ok", noticeMapper.selectByPrimaryKey(id));
    }

}
